#define xuser mixc::powerful_cat
#include"lang/cxx/ignore_case.hpp"
#include"lang/cxx/index_of_suffix.hpp"
#include"lang/cxx.hpp"
#include"mixc.hpp"
#include"utils/counter.hpp"

xinit(xuser::the_main){
    using namespace xuser;
    counter demo = 0;

    // 演示：匹配 pattern 列表中任意一个元素
    {
        xhint(demo);

        c08 str = "xxx@miao.email.com";

        // index = 1，这个 index 是 { 'h', 'H' } 这个 pattern 列表匹配的 index
        // 'H' 的 index = 1
        xhint(str.index_of_suffix({ "@gu.email.com", "@miao.email.com" }));

        // 匹配文件扩展名
        str = "main.CPP";
        xhint(str.index_of_suffix({ ".c", ".h", ".hpp", ".cpp" }, ignore_case<char>));
    }
};
